package com.yun.Vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
/**
 * @status 状态码
 * @message 结果信息
 * @data 数据
 */
public class ResultMessasge {

    private int status;
    private String message;
    private Object data;
    public static ResultMessasge fail(){
        return new ResultMessasge(201,"服务器运行失败", null);
    }
    public static ResultMessasge success(){
        return new ResultMessasge(200,"服务器运行成功", null);
    }
    public static ResultMessasge success(Object data){
        return new ResultMessasge(200,"服务器运行成功", data);
    }
    public static ResultMessasge success(String msg, Object data){
        return new ResultMessasge(200,msg,data);
    }
}
